<template>
  <div class="dv1">
    <div class="box" v-for="(item, index) in info" :key="index">
      <div class="layout" v-for="(items, index) in item" :key="index">
        <div class="left"><img :src="items.pic" alt="" /></div>
        <div class="right">
          <p>{{ items.goodsName }}</p>
          <p>{{ items.property }}</p>
          <p>x{{ items.number }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      tokens: localStorage.getItem("token"),
      copylist: [],
      info : this.$route.query.item
    };
  },
  mounted() {
    // console.log(this.$route.query.item);
    // this.copylist=this.$route.query.item
    // console.log(this.copylist);
    this.info = this.$route.query.item;
    // console.log(info);
    this.$API.MYorder({ token: this.tokens }).then((res) => {
      //   console.log(res);
      this.list = res.data.data.goodsMap;
      console.log(this.list);

      this.info = this.list.filter((item) => {
        if (item[0].id == info[0].id) {
          //   this.copylist.push(item);
          return item;
        }
      });
    });
    // console.log(this.copylist);
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.dv1 {
  margin-top: 8vh;
  font-size: 0.6rem;
  //   background: #f5f5f5;
  .box {
    width: 90%;
    // height: 4rem;
    // background: white;
    margin: 0.5rem auto;
    border: 1px solid blue;
    .layout {
      width: 100%;
      //   height: 4rem;

      margin: 0.5rem 0;
      display: flex;
      justify-content: space-around;
      align-items: center;
      .left {
        width: 25%;
        // background: red;
        img {
          width: 100%;
          //   height: 100%;
          border-radius: 1rem;
        }
      }
      .right {
        width: 65%;
        // background: chartreuse;
      }
    }
  }
}
</style>